package com.tupu.mapper.admin;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tupu.entity.admin.LabelInfo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LabelMapper extends BaseMapper<LabelInfo> {

    //根据图谱node_id 查询满足的label_list
    @Select("select * from label_list where label_list.node_id=#{node_id};")
    List<LabelInfo> findGraphByNodeId(Long nodeId);

    //通过本体id 查询本体名称
    @Select("select label from label_list where id=#{id};")
    String findlabelName(Long id);

    @Select("SELECT color FROM label_list WHERE node_id = #{nodeId} AND label = #{label};")
    String findColorByNodeIdAndLabel(Long nodeId, String label);

    //通过实体标签名称查询 node_id
    @Select("select id from label_list where label=#{label_name} and node_id=#{node_id};")
    Long findIdByLabelNameAndNodeId(String label_name,Long node_id);
}